Skip to content

Code fixes #2460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Code fixes #2460

wants to merge 2 commits into from

Conversation

martincostello
Copy link
Contributor

Fixes some issues I found while working on #2459.

  • Add missing entry to .resx file.
  • Regenerate resource designer code in Visual Studio to remove redundant properties.
  • Fix the namespace the resource designer generates with.
  • Use TryGetValue() and Count/Length to improve performance.
  • Fix typo in test name.
  • Sort usings.

- Add missing entry.
- Regenerate designer code to remove redundant properties.
- Fix the namespace the resource designer generates with.
- Use `TryGetValue()` and `Count`/`Length` to improve performance.
- Fix typo in test name.
- Sort usings.
@Copilot Copilot AI review requested due to automatic review settings August 8, 2025 13:32
@martincostello martincostello requested a review from a team as a code owner August 8, 2025 13:32
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses various code quality improvements and fixes discovered while working on issue #2459, focusing on performance optimizations, typo corrections, and resource file maintenance.

  • Fixes typo in test method name from "RemoveValidatioRule" to "RemoveValidationRule"
  • Improves performance by replacing LINQ .Any() calls with more efficient .Count > 0 and .Length != 0 checks
  • Optimizes dictionary operations using TryGetValue() to avoid multiple key lookups

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
test/Microsoft.OpenApi.Tests/Validations/ValidationRuleSetTests.cs Fixes typo in test name and replaces .Any() with .Count > 0 and .Length != 0 for performance
src/Microsoft.OpenApi/Validations/ValidationRuleSet.cs Sorts using statements and optimizes dictionary operations with TryGetValue() and .Count > 0
src/Microsoft.OpenApi/Properties/SRResource.resx Adds missing "ArgumentNull" resource entry
src/Microsoft.OpenApi/Microsoft.OpenApi.csproj Adds CustomToolNamespace for resource file generation
Files not reviewed (1)
  • src/Microsoft.OpenApi/Properties/SRResource.Designer.cs: Language not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant